﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Data;

namespace olierFrm.WebFormDev.Session
{
    [Serializable]
    public class SDataObject
    {
        public const string SessionID = "SessionDataObject";

        public static SDataObject Session
        {
            get
            {
                if (HttpContext.Current.Session[SessionID] == null) return null;
                return (SDataObject)System.Web.HttpContext.Current.Session[SessionID];
            }
            set
            {
                HttpContext.Current.Session[SessionID] = value;
            }
        }

        public Dictionary<string, DataSet> DataSource { get; set; }
        public Dictionary<string, Dictionary<string, List<int>>> SmartLookupDetailRowIdx { get; set; }
        //public DataSet DataSource { get; set; }
        public Dictionary<string, Dictionary<string, string>> ModuleConfig { get; set; }
        public string ModuleID { get; set; }
        private string _ObjectName;
        public string ObjectName
        {
            get
            {
                if (_ObjectName == null)
                    _ObjectName = ModuleConfig["DataObject"]["ObjectName"];
                return _ObjectName;
            }
        }

        public string Action { get; set; }

        public Dictionary<string, List<SSmartLookup>> SmartLookup { get; set; }

        /// <summary>
        /// 有SmartLookup的字段，需要构造弹出框
        /// </summary>
        public Dictionary<string, Dictionary<string, string>> DialogField { get; set; }

    }
}
